{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"https://raw.githubusercontent.com/Qiskit/qiskit-tutorials/master/images/qiskit-heading.png\" alt=\"Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook (and the image needs to be where this notebook is expecting it)\" width=\"500 px\" align=\"left\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# _*Random Terrain Generation*_\n",
    "\n",
    "The latest version of this notebook is available on https://github.com/qiskit/qiskit-tutorial.\n",
    "\n",
    "***\n",
    "### Contributors\n",
    "James R. Wootton, IBM Research\n",
    "***"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "From 1980's *Rogue* to recent games like *No Man's Sky*, [randomly generated content](https://en.wikipedia.org/wiki/Procedural_generation#Video_games) has become an important part of game design. This content is not generated in a completely random way, but is instead subject to a variety of constraints, like looking good, providing unique experiences for the player in every random sample, forming a solvable level and allowing this solvability to be efficiently verified.\n",
    "\n",
    "To satisfy these contraints, the procedure used to generate the random content can sometimes rely on reusing the same patterns over and over. Unfortunately this carries the risk of players recognising the patterns, which compromises the ability to keep providing unique experiences.\n",
    "\n",
    "Procedural generation is therefore another area in which quantum computers could be very useful. Not only can it be used for new methods of generating random content, it can also provide new algorithms to analyse the solvability of classical methods.\n",
    "\n",
    "In this notebook we perform a first experiment on quantum procedural generation. This will cover one of the simplest and most useful applications of procedural generation: the creation of random height maps.\n",
    "\n",
    "One of the current most popular methods to do this is [Perlin noise](https://en.wikipedia.org/wiki/Perlin_noise). Here's a sample ([source](https://commons.wikimedia.org/wiki/File:Perlin_noise.jpg)).\n",
    "\n",
    "![Perlin noise by Reedbeta on Wikimedia Commons](https://upload.wikimedia.org/wikipedia/commons/d/da/Perlin_noise.jpg)\n",
    "\n",
    "In this image, the white and black areas can be associated with mountains and valleys, respectively. This image could therefore be turned into mountainous terrain to explore in a game. In this notebook we will investigate how to generate something similar with Qiskit."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "First, let's choose how many qubits to use."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "n = 9"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Next, let's work out what to do with them. We will make a method designed for current and near-term devices, which means making the most out of a few qubits. However, we will also want to generate images with thousands of points. To allow this, we can measure the probabilities for each of the $2^n$ possible output bit strings that are possible for $n$ qubits. We can then associate each bit string with a point, and the height of the map can be the probability of that point.\n",
    "\n",
    "Getting all these probabilities will mean that we need a large number of shots, which is how many times we repeatedly run a quantum program to calculate statistics of the outputs."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "shots = 4**n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This method is therefore not scalable to large $n$: it has exactly the kind of exponentially increasing run time that quantum computers usually aim to free us from. Other quantum methods for procedural generation will therefore be needed in the [NISQ era](https://arxiv.org/abs/1801.00862) of quantum computing and beyond.\n",
    "\n",
    "For now, we need to choose a way of assigning each of the possible bit strings to a point. The most natural way to do this would be to respect the [Hamming distance](https://en.wikipedia.org/wiki/Hamming_distance) of the bit strings. This is because the basic operations of quantum computing, single qubit gates and `cx` gates, only have the effect of flipping a single bit in a bit string. Strings that differ by only a single bit can therefore be regarded as 'closer' to each other than those that differ by more.\n",
    "\n",
    "With this in mind, the set of all $n$-bit strings represents a hypercube: a shape that exists in $n$-dimensional space. This is a bit exotic for our needs, since we want the generate a 2D terrain map like the one depicted above. We therefore need a way to squash a hypercube onto a 2D surface.\n",
    "\n",
    "This is done in the following cell. The dictionary `strings` is created, which has 2D coordinates `(x,y)` as keys and the corresponding bit string as values. The squashing procedure essentially uses the fact that a cube is two squares, with each point in one connected to its partner in the other. A tesseract is then two cubes connected similarly, and so on for higher dimensional hypercubes. But if we don't include all the possible connections, we can keep our not-quite-a-cube flat, and then do the same with the corresponding not-quite-a-tesseract, and so on.\n",
    "\n",
    "The result is a square lattice. The four neighbours of each point are four of the $n$ hypercube neighbours of the corresponding string. So the strings are only close to strings that they should be close to, though at the cost of being far away from some of their hypercube neighbours."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "\n",
    "Lx = int(2**np.ceil(n/2))\n",
    "Ly = int(2**np.floor(n/2))\n",
    "\n",
    "strings = {}\n",
    "for y in range(Ly):\n",
    "    for x in range(Lx):\n",
    "        strings[(x,y)] = ''\n",
    "\n",
    "for (x,y) in strings:\n",
    "    for j in range(n):\n",
    "        if (j%2)==0:\n",
    "            xx = np.floor(x/2**(j/2))\n",
    "            strings[(x,y)] = str( int( ( xx + np.floor(xx/2) )%2 ) ) + strings[(x,y)]\n",
    "        else:\n",
    "            yy = np.floor(y/2**((j-1)/2))\n",
    "            strings[(x,y)] = str( int( ( yy + np.floor(yy/2) )%2 ) ) + strings[(x,y)]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The squashed hypercube we obtain above is just one of exponentially many we could have got. To explore this space a bit, and not end up with the same grid every time, we can perform a suffle. This reorders the bits in all the bit strings in the same way. This ensures the resulting squashed hypercube has all the properties we need, while allowing for some variation with each run."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "import random\n",
    "\n",
    "order = [j for j in range(n)]\n",
    "random.shuffle(order)\n",
    "\n",
    "for (x,y) in strings:\n",
    "    new_string = ''\n",
    "    for j in order:\n",
    "        new_string = strings[(x,y)][j] + new_string\n",
    "    strings[(x,y)] = new_string"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can also assert a bit of control over the hypercube by choosing which string lives at the center (actucally, it will be just to the top right of the center). By default, we choose this to be the string with all `0`s."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "center = '0'*n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "current_center = strings[ ( int(np.floor(Lx/2)),int(np.floor(Ly/2)) ) ]\n",
    "diff = ''\n",
    "for j in range(n):\n",
    "    diff += '0'*(current_center[j]==center[j]) + '1'*(current_center[j]!=center[j])\n",
    "for (x,y) in strings:\n",
    "        newstring = ''\n",
    "        for j in range(n):\n",
    "            newstring += strings[(x,y)][j]*(diff[j]=='0') + ('0'*(strings[(x,y)][j]=='1')+'1'*(strings[(x,y)][j]=='0'))*(diff[j]=='1')\n",
    "        strings[(x,y)] = newstring"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "With these manipulations complete, we now create the dictionary `pos`, which is ordered in the opposite way to `strings`: it has the strings as keys and coordinates as values."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "pos = {}\n",
    "for y in range(Ly):\n",
    "    for x in range(Lx):\n",
    "        pos[strings[(x,y)]] = (x,y)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now the grid is defined, we can deal with how to make an image of it. This is done with the following function, which will create a shaded block for each string at the positions defined by `pos`. It will also use `probs`, which will be a dictionary with the output strings as keys and their corresponding probabilities as values. The resulting shaded blockswill be darker for strings whose probability is low, and lighter for high probability strings.\n",
    "\n",
    "By default, the lowest probabilities are made black, the highest are white and the scaling of the shading is logarithmic. These can be turned off with the `log` and `normalize` kwargs."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "import matplotlib\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "def plot_terrain(pos,probs,log=True,normalize=True):\n",
    "\n",
    "    Z = {}\n",
    "    for node in probs:\n",
    "        if log:\n",
    "            Z[node] = np.log(probs[node])\n",
    "        else:\n",
    "            Z[node] = probs[node]\n",
    "        \n",
    "    minZ = min(Z.values())\n",
    "    maxZ = max(Z.values())\n",
    "    colors = {}\n",
    "    for node in Z:\n",
    "        if normalize:\n",
    "            z = (Z[node]-minZ)/(maxZ-minZ)\n",
    "        else:\n",
    "            z = Z[node]\n",
    "        colors[node] = (z,z,z,1)\n",
    "\n",
    "    fig = plt.figure()\n",
    "    ax = fig.add_subplot(111)\n",
    "    \n",
    "    for node in pos:\n",
    "        rect = matplotlib.patches.Rectangle(pos[node], 1, 1, color=colors[node])\n",
    "        ax.add_patch(rect)\n",
    "    plt.xlim([0, Lx])\n",
    "    plt.ylim([0, Ly])\n",
    "    plt.axis('off')\n",
    "    plt.savefig('output.png',dpi=1000)\n",
    "    plt.show()\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note that the plotting we are using won't be happy if all possible strings aren't present in `pos` with a non-zero probability. So we'll give all the outputs that don't appear a nominal probability of 1/`shots`.\n",
    "\n",
    "Here's a function to produce such a `probs` from the results contain in a `job` object."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_probs(job):\n",
    "    counts = job.result().get_counts()\n",
    "    probs = {}\n",
    "    for string in pos:\n",
    "        try:\n",
    "            probs[string] = counts[string]/shots\n",
    "        except:\n",
    "            probs[string] = 1/shots\n",
    "    return probs"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "It's time to make and run a quantum circuit. Let's start with a trivial circuit, and so one that outputs all `0`s."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAABBhJREFUeJzt3NFNwzAARVEbdYWK/bfLFDEboACtC5dzvqM4SOjSVOLNtdYA4O97e/UDAPAYgg4QIegAEYIOECHoABGCDhAh6AARgg4QIegAEbedh805jzHG+4VLz3H9j83Va92zc8/az+Oefj8+tdaaV66bO//1f85pZwDgi64G3VcuABGCDhAh6AARgg4QIegAEYIOECHoABGCDhAh6AARgg4QIegAEYIOELE76Ofm8wD+jd1B90YA8CQCCxAh6AARgg4QIegAEYIOECHoABGCDhAh6AARgg4QIegAEYIOECHoABHWFgEirC0CRAgsQISgA0QIOkCEoANECDpAhKADRAg6QISgA0QIOkCEoANECDpAhHEugAjjXAARAgsQIegAEYIOECHoABGCDhAh6AARgg4QIegAEYIOECHoABGCDhAh6AAR1hYBIqwtAkQILECEoANECDpAhKADRAg6QISgA0QIOkCEoANECDpAhKADRAg6QIRxLoAI41wAEQILECHoABGCDhAh6AARgg4QIegAEYIOECHoABGCDhAh6AARgg4QIegAEdYWASKsLQJECCxAhKADRAg6QISgA0QIOkCEoANECDpAhKADRAg6QISgA0QIOkCEcS4YY8w5X/0I8GO3zed5I+BXOs/rnzXEn99KYAEiBB0gQtABIgQdIELQASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSDC2iKMMY7juHzt/X5/4pPA98211r7D5tx3GEDEWuvSxKevXAAiBB0gQtABIgQdIELQASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSDC2iJAxO6geyMAeBKBBYgQdIAIQQeIEHSACEEHiBB0gAhBB4gQdIAIQQeIEHSACEEHiDDOBRBhnAsgQmABIgQdIELQASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSBC0AEiBB0gwtoiQIS1RYAIgQWIEHSACEEHiBB0gAhBB4gQdIAIQQeIEHSACEEHiBB0gAhBB4gwzgUQYZwLIEJgASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSBC0AEiBB0gQtABIgQdIMLaIkCEtUWACIEFiBB0gAhBB4gQdIAIQQeIEHSACEEHiBB0gAhBB4gQdIAIQQeIEHSACGuLABHWFgEiBBYgQtABIgQdIELQASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSDCOBdAhHEugAiBBYgQdIAIQQeIEHSACEEHiBB0gAhBB4gQdIAIQQeIEHSACEEHiBB0gIi51nr1MwDwAD6hA0QIOkCEoANECDpAhKADRAg6QISgA0QIOkCEoANECDpAhKADRAg6QISgA0QIOkCEoANECDpAhKADRAg6QISgA0QIOkCEoANECDpAhKADRHwAPElN4mnmb1EAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from qiskit import *\n",
    "\n",
    "q = QuantumRegister(n)\n",
    "c = ClassicalRegister(n)\n",
    "qc = QuantumCircuit(q, c)\n",
    "\n",
    "qc.measure(q, c)\n",
    "\n",
    "backend = Aer.get_backend('qasm_simulator')\n",
    "\n",
    "job = execute(qc, backend, shots=shots)\n",
    "\n",
    "probs = get_probs(job)\n",
    "plot_terrain(pos,probs)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here we just get a single peak in the center. Not very interesting. To make a mountain, we need to spread out the probability. One way to do this is to simply use the noise present in a real device."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAD4xJREFUeJzt3MtvlIX3x/Ez08sw4dIKgelNBrA3TSMhgUBk40aRuPcPcOnGf8jEtTuNUYlRw86kSkxjTSsOSG3t9IadNpRepvPMd/Fbaz+H3/M8A4f3a31ynvunMItPod1uGwDgxVfs9AkAANJBoANAEAQ6AARBoANA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SLvnJubk+bU9kgzs9XVVWnO09Dn+UeMSn2Wf//9t7zTU3er6O/vl2f/+usvac7TWKrO1ut1eaeKn1wAIAgCHQCCINABIAgCHQCCINABIAgCHQCCINABIAgCHQCCINABIAgCHQCCINABIIhcA71YLErlEp0uk3pRqF0dnS4bU7tksjhPtQDJ0yeiFmRlUc6VRXGdh1pi5ikGS7tEzNNho856MkntJPIUwqlyLecaHh6Wntzs7Gzqx/YU9jQajdSPn4Xjx49Lc52+nnPnzklzalnR5OSkfOwLFy5IcyMjI/LOkydPSnMnTpyQdw4PD0tznqbJdrstzQ0ODso71fP0hFWtVpNnFZ4ivps3b0pz8/Pz8s6+vj5p7vz58/JOFT+5AEAQBDoABEGgA0AQBDoABEGgA0AQBDoABEGgA0AQBDoABEGgA0AQBDoABEGgA0AQBDoABJFroPf09EjVZmqbnYdaVGTW+XZCldoUl3abnZdaKKU22qntjWZ6i6KnbbFUKklzPT098k61FVI9tpn+3D3thOp98rxznvuUNrVEzJNJ6vuuPnOPXNsW33rrLekpey70hx9+kObee+89eednn30mz6rURrvx8XF559jYmDT3ySefyDtVU1NT8uy7774rzamB7jn27du3pbkbN27IO9X38+zZs/LO999/X5rz/DG7e/euNPfGG2/IO9XzXFpakneq1cH//POPNDcxMSEf+9atW9Kceo5mZleuXJHm1HfTg59cACAIAh0AgiDQASAIAh0AgiDQASAIAh0AgiDQASAIAh0AgiDQASAIAh0AgiDQASCIXAO91WpJLUCesh511tPF4ClAUqkdHGqxj2f22LFj8s60j22md5+oz9JTpKUeWy1pMtOLmrq79aqktO+RZzaLZ5lFOZdamtfJd9NMfz9f+HKu9fV16SnPz8/LO9Wbt7a2Ju8sl8tWLpePnGs0GvJO9fgDAwPyztXVVWnO88fMQ/1w1FKln3/+WZrz3KPt7W1pbnNzU965uLgozW1sbMg71ePX63V559zcnDTn+YOv3k/1HpmZTU9Py7OKSqUiz6r3/dGjR/LOixcvSnOe/FDxkwsABEGgA0AQBDoABEGgA0AQBDoABEGgA0AQB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ABAEgQ4AQRDoABAEgQ4AQRDoABAEgQ4AQRDoABAEgQ4AQeQd6HpNHpACtWWz2WzKO9XmPU8bZtqNlHj+ed45VfqdkP+N/xEgV6dPn5bmHj9+LO9cXFx81tP5V7VaLfWdeL5tb2+nvpOABYAgCHQACIJAB4AgCHQACIJAB4AgCHQACIJAB4AgCHQACIJAB4AgCHQACIJAB4AgCHQACCLXQC8UCrQtIldqi2GS6K+m2rYI/BfPO6fK9c3s6+uT/oA0Go2sTwUviY2NDWnu1q1b8s7p6elnPZ1/dfnyZWluZmYm9WOjM8bHx1PfyU8uABAEgQ4AQRDoABAEgQ4AQRDoABAEgQ4AQRDoABAEgQ4AQRDoABAEgQ4AQRDoABBE3oEutdEUCoWszwMvCbUA6eDgQN5ZKpWe9XT+VbPZlOa6urpSPzY6w/POqXIt5yqXy5RzIVdjY2PS3NDQkLxzYGBAmltYWJB39vX1SXOtVkvemYVqtZr6Ts99Stvo6Kg0V6vVUj92pVJJfSc/uQBAEAQ6AARBoANAEAQ6AARBoANAEAQ6AARBoANAEAQ6AARBoANAEAQ6AARBoANAEAQ6AARRaLfbnT4HAEAK+Bc6AARBoANAEAQ6AARBoANAEAQ6AARBoANAEAQ6AARBoANAEAQ6AARBoANAEAQ6AARBoANAEAQ6AARBoANAEAQ6AARBoANAEAQ6AARBoANAEAQ6AARBoANAEAQ6AARBoANAEAQ6AATxP84nCFmB56dSAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from qiskit.providers.aer import noise\n",
    "\n",
    "IBMQ.load_account()\n",
    "\n",
    "backend_to_simulate = IBMQ.get_backend('ibmq_16_melbourne')\n",
    "noise_model = noise.device.basic_device_noise_model(backend_to_simulate.properties())\n",
    "job = execute(qc, backend, shots=shots,noise_model=noise_model,basis_gates=noise_model.basis_gates)\n",
    "\n",
    "probs = get_probs(job)\n",
    "plot_terrain(pos,probs)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here we have used noise in the system instead of trying to avoid it. This is another aspect of our method that makes it suitable for near-term devices.\n",
    "\n",
    "Now let's try another quantum circuit. This time with a GHZ state."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAABEhJREFUeJzt3EFu2zAARUGyyBWE3v92OoXYXZeFWkd0+jKzFkwFCJ4tA/5zrTUA+P/9ePcNAPA5BB0gQtABIgQdIELQASIEHSBC0AEiBB0gQtABIj52HjbnPMcYP29ceo37bzZ3r/Wandes/T1e0//HH6215p3r5s6f/s857QwA/KW7QfeVC0CEoANECDpAhKADRAg6QISgA0QIOkCEoANECDpAhKADRAg6QISgA0TsDvq1+TyAb2N30D0RADxEYAEiBB0gQtABIgQdIELQASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSDC2iJAhLVFgAiBBYgQdIAIQQeIEHSACEEHiBB0gAhBB4gQdIAIQQeIEHSACEEHiDDOBRBhnAsgQmABIgQdIELQASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSBC0AEiBB0gwtoiQIS1RYAIgQWIEHSACEEHiBB0gAhBB4gQdIAIQQeIEHSACEEHiBB0gAhBB4gwzgUQYZwLIEJgASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSBC0AEiBB0gQtABIgQdIMLaIkCEtUWACIEFiBB0gAhBB4gQdIAIQQeIEHSACEEHiBB0gAhBB4gQdIAIQQeIMM4FY4w557tvAV72sfk8TwR8Sdd1/7OG+PNVCSxAhKADRAg6QISgA0QIOkCEoANECDpAhKADRAg6QISgA0QIOkCEoANEWFuEMcZ5nrevPY7jwTuBfzfXWvsOm3PfYQARa61bE5++cgGIEHSACEEHiBB0gAhBB4gQdIAIQQeIEHSACEEHiBB0gAhBB4gQdIAIa4sAEbuD7okA4CECCxAh6AARgg4QIegAEYIOECHoABGCDhAh6AARgg4QIegAEYIOEGGcCyDCOBdAhMACRAg6QISgA0QIOkCEoANECDpAhKADRAg6QISgA0QIOkCEoANECDpAhLVFgAhriwARAgsQIegAEYIOECHoABGCDhAh6AARgg4QIegAEYIOECHoABGCDhBhnAsgwjgXQITAAkQIOkCEoANECDpAhKADRAg6QISgA0QIOkCEoANECDpAhKADRAg6QIS1xRfMOd99CwC/fWw+L/VEcF3335/EH3haKrAA35mgA0QIOkCEoANECDpAhKADRAg6QISgA0QIOkCEoANECDpAhKADRFhbfMF5nrevPY7jwTsBGGOutfYdNue+wwAi1lq35lp95QIQIegAEYIOECHoABGCDhAh6AARgg4QIegAEYIOECHoABGCDhBhnAsgYnfQPREAPERgASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSBC0AEiBB0gQtABIgQdIGKutd59DwB8Ap/QASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSBC0AEiBB0gQtABIn4BbGVa1aWP244AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "qc = QuantumCircuit(q, c)\n",
    "qc.h(q[0])\n",
    "for j in range(n-1):\n",
    "    qc.cx(q[j],q[j+1])\n",
    "qc.measure(q, c)\n",
    "\n",
    "job = execute(qc, backend, shots=shots)\n",
    "\n",
    "probs = get_probs(job)\n",
    "plot_terrain(pos,probs)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Again, it is not so interesting. This time, let's spread out the probability by adding in some single qubit gates. Specifically, we'll try rotations around the y axis by a few different angles."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "For rotations around the y axis by 0.0*pi\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAABEhJREFUeJzt3EFu2zAARUGyyBWE3v92OoXYXZeFWkd0+jKzFkwFCJ4tA/5zrTUA+P/9ePcNAPA5BB0gQtABIgQdIELQASIEHSBC0AEiBB0gQtABIj52HjbnPMcYP29ceo37bzZ3r/Wandes/T1e0//HH6215p3r5s6f/s857QwA/KW7QfeVC0CEoANECDpAhKADRAg6QISgA0QIOkCEoANECDpAhKADRAg6QISgA0TsDvq1+TyAb2N30D0RADxEYAEiBB0gQtABIgQdIELQASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSDC2iJAhLVFgAiBBYgQdIAIQQeIEHSACEEHiBB0gAhBB4gQdIAIQQeIEHSACEEHiDDOBRBhnAsgQmABIgQdIELQASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSBC0AEiBB0gwtoiQIS1RYAIgQWIEHSACEEHiBB0gAhBB4gQdIAIQQeIEHSACEEHiBB0gAhBB4gwzgUQYZwLIEJgASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSBC0AEiBB0gQtABIgQdIMLaIkCEtUWACIEFiBB0gAhBB4gQdIAIQQeIEHSACEEHiBB0gAhBB4gQdIAIQQeIMM4FY4w557tvAV72sfk8TwR8Sdd1/7OG+PNVCSxAhKADRAg6QISgA0QIOkCEoANECDpAhKADRAg6QISgA0QIOkCEoANEWFuEMcZ5nrevPY7jwTuBfzfXWvsOm3PfYQARa61bE5++cgGIEHSACEEHiBB0gAhBB4gQdIAIQQeIEHSACEEHiBB0gAhBB4gQdIAIa4sAEbuD7okA4CECCxAh6AARgg4QIegAEYIOECHoABGCDhAh6AARgg4QIegAEYIOEGGcCyDCOBdAhMACRAg6QISgA0QIOkCEoANECDpAhKADRAg6QISgA0QIOkCEoANECDpAhLVFgAhriwARAgsQIegAEYIOECHoABGCDhAh6AARgg4QIegAEYIOECHoABGCDhBhnAsgwjgXQITAAkQIOkCEoANECDpAhKADRAg6QISgA0QIOkCEoANECDpAhKADRAg6QIS1xRfMOd99CwC/fWw+L/VEcF3335/EH3haKrAA35mgA0QIOkCEoANECDpAhKADRAg6QISgA0QIOkCEoANECDpAhKADRFhbfMF5nrevPY7jwTsBGGOutfYdNue+wwAi1lq35lp95QIQIegAEYIOECHoABGCDhAh6AARgg4QIegAEYIOECHoABGCDhBhnAsgYnfQPREAPERgASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSBC0AEiBB0gQtABIgQdIGKutd59DwB8Ap/QASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSBC0AEiBB0gQtABIgQdIELQASIEHSBC0AEiBB0gQtABIn4BbGVa1aWP244AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "For rotations around the y axis by 0.1*pi\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAADPZJREFUeJzt3M1vlOXbBuB7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2iDqIgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "For rotations around the y axis by 0.2*pi\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAEl5JREFUeJzt3Mtv1vXWhvFv5dASEk0c7B0gipwFy7mthRBNNMGgAxSdKQIaCf+TksZEgwYTMZxFhGChUMRSQIIICtgoAw2KhZ5o+0729H251n6f39O4cn3GK+t3vp+mg7thfHy8SJL++R6Z6BOQJNWGgS5JSRjokpSEgS5JSRjokpSEgS5JSRjokpSEgS5JSRjokpTE5HoebOvWrbdLKf9+2Nzx48fHRkZG0I/NjBkzxiZNmvTQ2ZGRkbHCf8DQbHNz89iUKVPQzuvXr4+Njo4+dPbMmTP42t96662xadOmPXT2yJEjY8PDw2jno48+OvbII4+QWXw/V65cie5Td3f32IMHDx4619raOjZ16lR07OXLl6Njr1ixAj/Lnp4edJ4XLlxAc6WUsmzZMnT83t5evPPo0aPoua9btw7fz5aWFnSely5dQu97Kfx+Dg0NoXfur7/+GhsfH0fHfvHFF8caGxsfOrt3796xoaEhtHPDhg1jTU1ND52l30UppezYsaOBzNX7L/SHhnkppdBAK6UUEub/EblWNEsfRiml0Jc7cu0kzEsphYZ5KaXAMC8lcD/pfaJBRcMncuzIs6TnSecix4/spM+9ivtJ3/dSQteE5miYl1IKCfNSSqFhXkopJMxLib1zlP9ykaQkDHRJSsJAl6QkDHRJSsJAl6QkDHRJSsJAl6QkDHRJSsJAl6QkDHRJSsJAl6QkDH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w0CUpCQNdkpIw0CUpCQNdkpIw0CUpCQNdkpIw0CUpCQNdkpIw0CUpif8B5DBkD1DymiMAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "For rotations around the y axis by 0.3*pi\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAEz5JREFUeJzt3EtsVeUaxvG33S297Bpw4ploWgGNBPCSKBaIUIFKLSJBoaClttRSFPEycEQipDHqwOjEgEURLPdqQKQNSGm5BKS0KGgIDhBpw+hMDW0pu3RzRmfo6fOds9fu8eX/G79517fWXuspYfBk3L592wAAf3+Zo30AAEBqEOgA4ASBDgBOEOgA4ASBDgBOEOgA4ASBDgBOEOgA4ASBDgBOZKXzYhs2bPinmf1jpLlt27YlBwcHpT82ZWVlyZycnBFnOzo6kolEQtpZUlIi7YzH48nMzExpZyKRSJrwB/TYsWPJoaEhaefSpUuTubm5I85+/PHHyYGBAWlndXV1Mj8/f8TZ1tZW+XnW1NRIOxsbG5M3btwYcW716tXSPjOze++9NxmLxUacnTJlSjI7O1vaeenSpeTw8PCIsz09PclkMintLCwsTGZlZY0429vbK+9sbm5O3rx5c8TZZcuWJfPy8lL6PEPO2dTUJH3v8+fPl77LlpYW6b7NzGpra6V3affu3XImVVVVSc/zvvvuk56lmdmKFSsylLl0/wt9xDA3M1MfnJmZ8gObmanhE7JTDfN/jytDapibmSlhbmamhrmZmRqUIc9T3amEecg+MzP1g1HD3MxMCXMzMzXQzMyUMA/dqYaaGuZm+v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Y0F9JnohZ5hXTOjBkzJuU7oygHi+Kc6u/5d3g3Q+Tk5KR8Z0YUjV9/ZcqUKdLFpk+fLu/Mz8+X5kI+2Hg8Ls1NmzZN3qkWEIWc89ChQ9JcSFGS+jGEvOAHDhyQ5hYsWCDNtbS0yNdes2aNNDdhwgR559WrV6U5tVDJzKy+vl6a++yzz+SdFRUV0ty+ffvknWvXrpXmtmzZIu8sLy+X5u666y5p7s8//5SvvXfvXmmupqZG3tna2irNVVdXyzsbGhqkFkL+ywUAnCDQAcAJAh0AnCDQAcAJAh0AnCDQAcAJAh0AnCDQAcAJAh0AnCDQAcAJAh0AnCDQAcCJtJZzAQCiw7/QAcAJAh0AnCDQAcAJAh0AnCDQAcAJAh0AnCDQAcAJAh0AnCDQAcAJAh0AnCDQAcAJAh0AnCDQAcAJAh0AnCDQAcAJAh0AnCDQAcAJAh0AnCDQAcAJAh0AnCDQAcAJAh0AnCDQAcCJfwG5169XwuXflwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "For rotations around the y axis by 0.4*pi\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAE6VJREFUeJzt3MlvlXXYxvG70AKLDlAGt67YuLIMHYG40ETbgEVUTCOEoZRCqZWiFkPUSDTBgrRlaIEyWKwSEVpQEuNGpo5YcIP+C2qBlh5NCm0P7+bdvuH6Jec5fb37/azv3M/vPMNVwuJKefLkiQEA/vumTfYBAACJQaADgBMEOgA4QaADgBMEOgA4QaADgB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wh0AHCCQAcAJwh0AHCCQAcAJwh0AHCCQAcAJwh0AHCCQAcAJ/4H6RHGwZnl/YQAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "For rotations around the y axis by 0.5*pi\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAACOhJREFUeJzt3FFuGukWhdEqsGEEJPOfW5J2agZgQ/UQckri/FZt1pL8hg5g8JfWle6e13WdANi/w3e/AACeQ9ABQgg6QAhBBwgh6AAhBB0ghKADhBB0gBCCDhBiaNDXdf1YC378+HGf53mt/Hx8fNwfj8f6r58tN//8+XP/+vpa//WTeHMPv8+/f//eK9+jLd+l6vve8t6r73vLe+94nR03//vvv/v9fl8rP8++ueW7+fv37/vn5+f6r58tN3/9+nW/3W7rv3623Kw2dh75f/1fi092ONT/nbnf76XHHY/H8s3Pz8/S497f3+Nu7uH3+Xg8ys9d/S5V3/c01d979X1PU/29d7zOjptfX1/lm29vb0+9Wb03TdN0u91KjzudTuWb1+u19Ljz+Vy+ua7rXHmc/8kFIISgA4QQdIAQgg4QQtABQgg6QAhBBwgh6AAhBB0ghKADhBB0gBCCDhBiaNCXZSmtKv38+bN88+Pjo/Q4N3NuVu+5+Zo3077vWwxdW6zOQHasv1VX1aapvqy2l5W6tNW/LUuPHWt6e1n961jj7FgSfPbvs+P73nFzy9/68Xi0tgjwSgQdIISgA4QQdIAQgg4QQtABQgg6QAhBBwgh6AAhBB0ghKADhBB0gBBDg365XEpri2nrb25a03Nz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MOsYiXrVobWOm3sZRdty83A4GOcCeCWCDhBC0AFCCDpACEEHCCHoACEEHSCEoAOEEHSAEIIOEELQAUIIOkCIoeNcAPTxX+gAIQQdIISgA4QQdIAQgg4QQtABQgg6QAhBBwgh6AAhBB0ghKADhBB0gBCCDhBC0AFCCDpACEEHCCHoACEEHSCEoAOEEHSAEIIOEELQAUIIOkCI/wFxSHfRUx9z3QAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "for frac in [0.0,0.1,0.2,0.3,0.4,0.5]:\n",
    "    \n",
    "    qc = QuantumCircuit(q, c)\n",
    "    qc.h(q[0])\n",
    "    for j in range(n-1):\n",
    "        qc.cx(q[j],q[j+1])\n",
    "    qc.ry(np.pi*frac,q)   \n",
    "    qc.measure(q, c)\n",
    "\n",
    "    job = execute(qc, backend, shots=shots)\n",
    "\n",
    "    probs = get_probs(job)\n",
    "    print('\\nFor rotations around the y axis by '+str(frac)+'*pi')\n",
    "    plot_terrain(pos,probs)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "These take us from the twin peaks of the GHZ state to a checkerboard pattern, thanks to the interference effects in quantum states. We find some interesting patterns along the way.\n",
    "\n",
    "These interference effects are one way that quantum procedural generation can avoid the playing 'seeing behind the curtain' and recognizing the way the random patterns are created: quantum effects are quite removed from human experience, and so we have less intuition that helps us recognize them."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "So far we've experimented with just one or two peaks. For something that looks like Perlin noise, we need a constant density. For this we can set a density `rho`, and then use it to pick a random set of points. This can then be turned into a vector representing the quantum superposition of the corresponding bit strings."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "rho = 0.1\n",
    "N = int(rho*2**n)\n",
    "state = [0]*(2**n)\n",
    "for j in range(N):\n",
    "    state[ int(random.choice(list(pos.keys())),2) ] = 1\n",
    "Z = sum(np.absolute(state)**2)\n",
    "state = [amp / np.sqrt(Z) for amp in state]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can then initialize the circuit with this state, and again try using `ry` rotations by different angles."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "For rotations around the y axis by 0.0*pi\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAABoBJREFUeJzt3N1x4koUhVHJdVMA8s8O4xiEbgKu4rRHf717rWcVmEb67HmYPa/rOgHQv6+zfwAAtiHoACEEHSCEoAOEEHSAEIIOEELQAUIIOkAIQQcI8d+RbzbP83Oapsen657P5/t+v5d+2Twej/fPz0/l2vdU/wVWvdZrnvOaaZ+nfO3393f52bjf71HPRvWzN3zu8ns3XLfLa67rOleum4/8r//zPJfe7P1+l1/z68s/MhhHy/M6z6UGdKP62dM+9zTVg66GACEEHSCEoAOEEHSAEIIOEELQAUIIOkAIQQcIIegAIQQdIISgA4QQdIAQRwe9tLr1fD7LL3i73f78w3At1VGlkQfZ9ng2Wsaszjz76mfvpQl7jIhdcm2RMVVXNlsehMTlva21rJtWz9O5f9bYXmuLACMRdIAQgg4QQtABQgg6QAhBBwgh6AAhBB0ghKADhBB0gBCCDhBC0AFCXHJtsYURoBzVNb1lWcqv2cvy3plaFhyrZ+/cP2s596ru1xarS3EjT64CfVvX1doiwEgEHSCEoAOEEHSAEIIOEELQAUIIOkAIQQcIIegAIQQdIISgA4S45DhXy+BWdeDGWFCO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QcIIegAIQQdIISgA4QQdIAQgg4QQtABQhwa9NvtZm3xgz0W+noZIKqu5FVX99jeHvdS9TWrz0Z1QXGa+llRrDp0bXGaptKb9RKgXvSy4Djyml4vqt9Ry7lb2fzM2iLAYAQdIISgA4QQdIAQgg4QQtABQgg6QAhBBwgh6AAhBB0ghKADhBB0gBCHBv31epVWeFoW0IwvfbbHguMerOldX3URs+Xcq9+77/KzQ9cW53ne/M0stcFx9lhb5DNriwCDEXSAEIIOEELQAUIIOkAIQQcIIegAIQQdIISgA4QQdIAQgg4Q4uig14ZXGhj2gd/tsafiebu27se5gN8Z0sphnAtgMIIOEELQAUIIOkAIQQcIIegAIQQdIISgA4QQdIAQgg4QQtABQgg6QIhDx7kA2I+/0AFCCDpACEEHCCHoACEEHSCEoAOEEHSAEIIOEELQAUIIOkAIQQcIIegAIQQdIISgA4QQdIAQgg4QQtABQgg6QAhBBwgh6AAhBB0ghKADhBB0gBD/A58quWxRNrPLAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "For rotations around the y axis by 0.1*pi\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAFPdJREFUeJzt3H9s1fW9x/H3oS0ttBXk1yWIISY4nWGoY/5AE38RQTEbMca44MyWbcyJRIJTJ2gyrX+AQePPqBG2YCxCMiEC/gzGmMXpFpwwxzQ4NdP4A7TIj5baWnp6/7h/3jieH9eee+/7Ph9/v/I+7Tnf84L0j1dlYGAgJEn/9w37n/4BJEmDw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7kuEp6rLLLkO59vZ2fPPNN9/8pj/O15oxYwbKXXrppfjmrbfe+k1/nK+1b98+lFu7di2+Sfti7969+OaWLVtQbu7cuShXsmy6evVqlCtZa50yZQrKjRo1Ct/cvHkzan//5CJJSVjokpSEhS5JSVjokpSEhS5JSVjokpSEhS5JSVjokpSEhS5JSVjokpSEhS5JSVjokpRETce5JElDx/+hS1ISFrokJWGhS1ISFrokJWGhS1ISFrokJWGhS1ISFrokJWGhS1ISFrokJWGhS1ISFrokJWGhS1ISFrokJWGhS1ISFrokJWGhS1ISFrokJWGhS1ISFrokJWGhS1ISFrokJWGhS1IS/wm3CIrdUpjTvwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "For rotations around the y axis by 0.2*pi\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAFQNJREFUeJzt3GmM1fW9x/HvLGeGAWYERMEEELVV4xpcEAgl1baCxn2LdUlNQFRajbE+0FabNqltU4gpBbUam0jamJZYu6gtLiBUxUTrArRFtCotDFBZBGZgHIY5cx/c9mEz79+9M6e93/t+Pf7m+z//7XNOzoNPXV9fX0iS/u+r/3d/AEnSwDDQJSkJA12SkjDQJSkJA12SkjDQJSkJA12SkjDQJSkJA12Skmis5cEef/zxbRExpr+5+vr6al1dHfqy2bZtW7VarfY7+41vfKPa2dmJdi5atKja1tbW72xzczP+nGvXrq0ePHiw39mxY8dWGxoa0M5qtVoN8KVcsnPDhg3V3t7efmdnzZpVbW5uRjvf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LklJGOiSlISBLklJ1LScS5I0ePyFLklJGOiSlISBLklJGOiSlISBLklJGOiSlISBLklJGOiSlISBLklJGOiSlISBLklJGOiSlISBLklJGOiSlISBLklJGOiSlISBLklJGOiSlISBLklJGOiSlISBLklJGOiSlISBLklJ/BfFja7WDZR2DAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "For rotations around the y axis by 0.3*pi\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAFPZJREFUeJzt3FmM3nW9x/HvzDwznaUzLZQytjo0FKrUtmQmgrZlq0KgKRAJVlNEQkqkUoNsasDEBqJRxAts0RTTIg0XoGFtVGIicbAxFK1E2QlLSxftilCm084+cy7OOZfn8P4dZx7P+Z736/qb7+/5L8/nmczFp2ZsbCwkSf/31f6rP4AkaXwY6JKUhIEuSUkY6JKUhIEuSUkY6JKUhIEuSUkY6JKUhIEuSUlUqnnYunXr9kdE+wfN7dq1a3R0dBT92IyNjY0G+GFqa2sbra2tRTs7OztH6+vrP3C2t7cXnR0RMWvWrNFKpfKBswcOHMDX/sorr4yOjIx84Oy8efPQ9UTwa+ro6Bitq6tDO9966y30OadMmYKeUW1t7WhNTQ06e9++feh+bt68eXRgYADtnDlzJrr2z3/+86NNTU1oZ11dHbqmLVu2jA4NDaGdJ598Mnrn3n77bfR8IiJmzJiBrn3hwoWjDQ0NaGdzczN67vR97+7uHh0cHERnv/nmm2jnZZddNtrY2Ih2trS00KzB+bF8+fIaMlftv9A/MM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T+DaTolkLlIDr6AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "For rotations around the y axis by 0.4*pi\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAFOBJREFUeJzt3Hts1/W9x/F3L7RQKgUvUJAJVqJC4mWVBYNOHENFDQuLTp3Gu6i4RRMXjZmZJm5ZNnVj2dwyR4iXzXj7YzpBphhRM0XUeGfMxijKBg3DCoVSWsqv54+T/XlOn59z2t/xvPd8/P3K+9dff9/fC9I/XjWDg4MhSfr/r/b/+geQJA0PC12SkrDQJSkJC12SkrDQJSkJC12SkrDQJSkJC12SkrDQJSmJ+mq+WE1NTWdETBoqd+utt1aam5vRPzaPPvpopa+vb8jskiVLKk1NTehmc3Nzpba2dsjs1q1bK5VKBd1cuHBhpbGxcchsR0dHZf/+/ejmJZdcUtm5c+eQ2dtvvx3/PqdPn16pr68fMrtv375KwP8Q7NmzB2W7u7srg4ODQ+befvvtysDAAHrt9vb2yqhRo4bM7t69G712RERnZyf63E899VT0mUdENDQ0VGpqaobMvv/++/j52L59O3pPM2bMQJ95RMT1119f2bVr15DZ1atXVw488EB0s7a2Fr33VatWVfr7+4fM1dXVoXsREXfddVdlz549Q2ZPP/10/FkuXboUdc3HH3+MP8srr7yyhuSq/T/0Ics8IoKWT0QEKfOICFrmERGkzCMiaJlHRNCHgX7AERGkzCPKfp/0ix1lzw7K0kKlZR4RQcq85LUj+OdOP/OICFpAJc8HfU8Fn3mQMo+IoGUewd87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eco19jYiG9SdEir5Bmm2ZJnbiR+71T9sF/8bzQ2NqJ/QEqW7y644AKUu+qqq/DNb37zmyh38skn45vXXHMNyv3lL3/BN7ds2YJytbW1sX//fpSlD1lbWxvKRUS8/PLLKLd48WKUe/PNN/FrT5o0CeWeffZZfPPhhx9GubFjx+Kbt95667C+dkTE5ZdfjnI33XQTvtnZ2RmdnZ1D5ubOnVt0k+jo6EA5umwaEbF+/XqU++lPf4pv0n945s2bh29S/slFkpKw0CUpCQtdkpKw0CUpCQtdkpKw0CUpCQtdkpKw0CUpCQtdkpKw0CUpCQtdkpKoaqHX1NSgBaSScZ3Ro0ejXG9vL75Jx6xKtjro6zc0NOCbdASov78f3xyJsSI6IkY3MEoGzOiGDf0ZI/hnWTL4Rd9TyfNBf046ihbBf58lzwd9fZor+R3V17M5q5KhNark905VdZzr4IMPHvZxLjpANHPmTHzz5z//Ocpdd911+GZHRwdaqjvrrLPwTfpAjBs3Dt+k/5jRQaUIvk5IF/ref/99/Nq0VGfNmoVvNjY2oruvv/46vvm73/0O5W6++WZ8c8eOHWidceLEifjmpk2bUO7RRx/FN6+++mqU27ZtG8q1trbi1169ejXKTZkyBd985JFHUO6iiy7CNyn/5CJJSVjokpSEhS5JSVjokpSEhS5JSVjokpSEhS5JSVjokpSEhS5JSVjokpSEhS5JSVjokpRETcmyoSTpi8v/oUtSEha6JCVhoUtSEha6JCVhoUtSEha6JCVhoUtSEha6JCVhoUtSEha6JCVhoUtSEha6JCVhoUtSEha6JCVhoUtSEha6JCVhoUtSEha6JCVhoUtSEha6JCVhoUtSEha6JCVhoUtSEv8B+GyW43zHq2oAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "For rotations around the y axis by 0.5*pi\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSU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yrpPqIGBATRXUq5Tj89J+1Ro+VFEfcq52tvb0dyePXvQXMm1pPeopJuG9geV7KQFZvTsCH7fST/KP9FenpJ3mM7S8raS97LkelL03Sjph6EaWs5Vq9WayM0bNWoUvsmDg4Nobvbs2WguImLBggVobt26dXjnhAkT0FxJUO7cuRNdJ1r8FPGPUCVB1Nvbi3d2d3ejuaGhodi9e/ewcyUvIX0+6I9ORH3aOKvVarS2tg47N336dLzz5ptvRnPbtm3DPz60+Grt2rVoLiLi97//PZr71re+heZ6enrw2StWrEBzJe/6Mcccg+ZKytso/+UiSUkY6JKUhIEuSUkY6JKUhIEuSUkY6JKUhIEuSUkY6JKUhIEuSUkY6JKUhIEuSUkY6JKURKWkFU2S9O/Lv9AlKQkDXZKSMNAlKQkDXZKSMNAlKQkDXZKSMNAlKQkDXZKSMNAlKQkDXZKSMNAlKQkDXZKSMNAlKQkDXZKSMNAlKQkDXZKSMNAlKQkDXZKSMNAlKQkDXZKSMNAlKQkDXZKSMNAlKYn/Aq6bsFVMWgwrAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "for frac in [0.0,0.1,0.2,0.3,0.4,0.5]:\n",
    "    \n",
    "    qc = QuantumCircuit(q, c)\n",
    "    qc.initialize(state,q)\n",
    "    qc.ry(np.pi*frac,q)   \n",
    "    qc.measure(q, c)\n",
    "\n",
    "    job = execute(qc, backend, shots=shots)\n",
    "\n",
    "    probs = get_probs(job)\n",
    "    print('\\nFor rotations around the y axis by '+str(frac)+'*pi')\n",
    "    plot_terrain(pos,probs)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We could also have spread out the peaks by simply using the noise of a real device. Since the process of creating our initial state is quite involved, this will have quite a lot of noise."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iV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RRjoklSEgS5JRRjoklSEgS5JRRjoklSEgS5JRfQ10Hd2dna9bZE2q2Xa0mhJVKbFkLbp0fa3CH7umSZBek6ZtkVaQETve+Z8aCFb5rrT0q12u4130ucj827QZz5zL6leNB7Se5m57vR5z+QHPZ9/fdvirVu30B3JtOmNjY2hucXFRbyTtig+e/YM7/zhhx/Q3IkTJ/DOZrOJ5u7evYt30rDMNNrRJkHa0EcbISMi/vzzTzT39ddf4503b95Ec5lgGR4eRtc+0+A4OjqK5l69eoUbAj/66CM09+LFCzQXwa8T/YwTExP42AMDA+iLYnJyEu+k131ubg7vpPzLRZKKMNAlqQgDXZKKMNAlqQgDXZKKMNAlqQgDXZKKMNAlqQgDXZKKMNAlqQgDXZKK6Gugd7td1NiT6cCgJUCZIi06S0u8MjLnTntXaKlRRqbQabeLpzJFWvReZoqSMn0qFL2emXIueu6ZIi36OTP3iD6fdC7zbNJrlMkPir4XGX0t5+p0OuiOTE9P4523bt1Cc/Pz83jnw4cPd30n/Zzj4+N4Jy0mo2VjERGzs7NojhZpRfzPi0iC6Pr162hf5ro3Gg3UlLe2thZra2to58rKCpqjJU0RvKhpamoK76TX6fnz53gnLfLKhNXS0hKaO3LkCJobHBzEX1K0dKsXPzJpuV6Gf7lIUhEGuiQVYaBLUhEGuiQVYaBLUhEGuiQVYaBLUhEGuiQVYaBLUhEGuiQVYaBLUhEGuiQV0aCNfZKk/27+QpekIgx0SSrCQJekIgx0SSrCQJekIgx0SSrCQJekIgx0SSrCQJekIgx0SSrCQJekIgx0SSrCQJekIgx0SSrCQJekIgx0SSrCQJekIgx0SSrCQJekIgx0SSrCQJekIgx0SSrCQJekIv4DUBiT/WNuZXIAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "qc = QuantumCircuit(q, c)\n",
    "qc.initialize(state,q)\n",
    "qc.measure(q, c)\n",
    "\n",
    "job = execute(qc, backend, shots=shots,noise_model=noise_model,basis_gates=noise_model.basis_gates)\n",
    "\n",
    "probs = get_probs(job)\n",
    "plot_terrain(pos,probs)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Clearly our Terrain maps are blockier than the example of Perlin noise shown at the top. This could be dealt with by adding more qubits, or simply by being careful in choosing how we apply the method. When generating terrain with Perlin noise, multiple layers are often used to create a good effect. Perhaps in future, some of those layers could be quantum.\n",
    "\n",
    "For another example of generation images using qubits, see the [Quantum Animations](quantum_animations.ipynb) notebook."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "keywords = {'Topics': ['Creative','Games','Procedural generation','Images','Entanglement'], 'Commands': ['`ry`','`initialize`','`noise_model`','`basic_device_noise_model`']}"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
